package org.japo.java.swing.listeners;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.IOException;
import org.japo.java.swing.igu.IGU;

public class GEV extends WindowAdapter{

    private final IGU igu;

    public GEV (IGU igu) {
        this.igu = igu;
    }

    @Override
    public void windowOpened(WindowEvent e) {
        try {
            igu.activarInstancia();
        } catch (IOException ex) {
            igu.terminarPrograma();
        }
    }
    
    

    @Override
    public void windowClosing(WindowEvent e) {
        try {
            igu.desactivarInstancia();
        } catch (IOException ex) {
            igu.terminarPrograma();
        }
    }

    @Override
    public void windowClosed(WindowEvent e) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void windowIconified(WindowEvent e) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void windowDeiconified(WindowEvent e) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void windowActivated(WindowEvent e) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void windowDeactivated(WindowEvent e) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

}
